<template>
  <div class="workscheduling-container">
    <div style="padding:10px 0;">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="材料">
          <el-select v-model="formInline.region" placeholder="请选择">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="气体">
          <el-select v-model="formInline.region" placeholder="请选择">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="厚度">
          <el-select v-model="formInline.region" placeholder="请选择">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="零件间距">
          <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
        </el-form-item>
      </el-form>
    </div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="引线参数" name="1">
        <el-form ref="form" :model="formInline" label-width="80px">
          <el-form-item label="引入线">
            <el-row :gutter="10">
              <el-col :span="4">
                 <span>类型:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>长度:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
            <el-row :gutter="10">
              <el-col :span="4">
                 <span>角度:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>半径:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
            <el-row :gutter="10">
              <el-col :span="12">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>圆孔半径:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
          </el-form-item>
          <el-form-item label="引入线">
            <el-row :gutter="10">
              <el-col :span="4">
                 <span>类型:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>长度:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
            <el-row :gutter="10">
              <el-col :span="4">
                 <span>角度:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>半径:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
            <el-row :gutter="10">
              <el-col :span="12">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>圆孔半径:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
          </el-form-item>
          <el-form-item label="引入线">
            <el-row :gutter="10">
              <el-col :span="4">
                 <span>类型:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>长度:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
            <el-row :gutter="10">
              <el-col :span="4">
                 <span>角度:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>半径:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
            <el-row :gutter="10">
              <el-col :span="12">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
              <el-col :span="4">
                 <span>圆孔半径:</span>
              </el-col>
              <el-col :span="8">
                <el-input-number v-model="formInline.user" :precision="2" :step="0.1" :max="10"></el-input-number>
              </el-col>
            </el-row>
          </el-form-item>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="补偿参数" name="2"></el-tab-pane>
      <el-tab-pane label="微连参数" name="3"></el-tab-pane>
      <el-tab-pane label="角工艺参数" name="3"></el-tab-pane>
      <el-tab-pane label="林缺点参数" name="3"></el-tab-pane>
    </el-tabs>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </div>

</template>
  
  <script>
export default {
  name: 'Workscheduling',
  data() {
    return {
      formInline: {},
      dialogVisible: false,
      activeName: '1',
      val: '',
      copyLike: '',
      channelUrl: '',
      channelList: [],
      fit: 'scale-down',
      projectArr: [],
      templateType: [],
      categoryArr: [],
      type_hdlbarr: [],
      type_hdlxarr: [],
      dialog: false, //新增模板合同弹窗
      title: '', //查看模板合同弹框标题
      tmplateName: '', //合同模板名称输入框
      // contractName: '',
      tableData: [], //数据列表
      currentPage: 1, //初始页
      total: null,
      imgLoadPath: this.$API.ASSET_IMAGES_URL,
      uploadDocUrl: '',
      DOC_PATH: this.$API.DOC_PATH,
      query: {
        page: 1,
        keyword: '',
        pageSize: 10,
        status: 0,
        status_show: -1
      },
      dialogTitle: '活动新增',
      modelType: 1,
      itemId: '',
      questionList: [],
      multipleSelection: [],
      jsonFields: {},
      fillName: '',
      publiceUrl: '',
      exhibition_url: '',
      checkAll: false,
      checkedCities: [],
      cities: ['上海', '北京', '广州', '深圳'],
      isIndeterminate: true
    };
  },
  filters: {
    formDate: (val) => {
      return global.getdate1(val);
    }
  },
  mounted() {
    // this.initAjaxMethod();
  },
  methods: {
    handleClick() {

    },
    handleCopyLike(row) {
      this.copyLike = window.location.origin + '/weChatApp/#/matchDetail?id=' + row.id;
      this.dialog = true;
    },
    // 多选操作
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    //新建
    createBus() {
      this.$router.push({ path: '/zhactiveAdd', query: { type: 1 } });
    },
    //查看模板合同
    handleClick(data) {
      this.$router.push({ path: '/zhactiveAdd', query: { type: 2, id: data.id } });
    },
    //企业列表接口
    initAjaxMethod() {
      const loading = this.$loading({ text: '加载中...' });
      this.$http
        .post(this.$API.ZHACTIVE_INDEX, {
          page: this.query.page,
          keyword: this.query.keyword,
          pageSize: this.query.pageSize,
          status: this.query.status,
          status_show: this.query.status_show
        })
        .then((res) => {
          console.log('**************', res);
          loading.close();
          if (res.code == 1) {
            let list = Array.isArray(res.data.list) ? res.data.list : [];
            list.forEach(item => {
              item.status_show_switch = item.status_show == 0 ? true : false;
            });
            this.tableData = list;
            this.total = res.data.count;
          } else {
            this.$message.error(res.msg);
          }
        })
        .catch((err) => {
          this.$message.error(res.msg);
        });
    },
    //重置
    reset() {
      this.query.page = 1;
      this.query.keyword = '';
      this.query.exhibition_id = '';
      this.query.status = 0;
      this.query.status_show = -1;
      this.query.signup_type = -1;
      this.initAjaxMethod();
    },
    delAllSelection() {
      let arr = [];
      if (this.multipleSelection.length <= 0) {
        this.$message({
          type: 'error',
          message: '请选择活动'
        });
        return false;
      } else {
        this.multipleSelection.forEach((item) => {
          arr.push(item.id);
        });
        this.handleDelete(arr.join(','), this.$API.ZHACTIVE_ALL_DEL);
      }
    },
    changeStatus(item) {
      console.log('item', item);
      const loading = this.$loading({ text: '加载中...' });
      this.$http
        .post(this.$API.ZHACTIVE_STATUS, {
          id: item.id,
          status_show: item.status_show_switch == true ? 0 : 1
        })
        .then((res) => {
          loading.close();
          if (res.code == 1) {
            this.$message.success('操作成功!');
            this.initAjaxMethod();
          } else {
            this.$message.error(res.msg);
          }
        })
        .catch((err) => {
          this.$message.error(res.msg);
        });
    },
    //删除合同模板信息
    handleDelete(id, url = this.$API.ZHACTIVE_DEL) {
      console.log(id);
      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$http.post(url, { id: id }).then((res) => {
          if (res.code == 1) {
            this.$message({
              type: 'success',
              message: '删除成功!'
            });
            this.initAjaxMethod();
          } else {
            this.$message({
              type: 'error',
              message: res.msg
            });
          }
        });
      });
    },
    //点击第几页
    handlePageChange(currentPage) {
      this.query.page = currentPage;
      this.initAjaxMethod();
    },
    //点击第几页
    handleSizeChange(currentPage) {
      this.query.pageSize = currentPage;
      this.initAjaxMethod();
    },
    handleCheckAllChange(val) {
      this.checkedCities = val ? cityOptions : [];
      this.isIndeterminate = false;
    },
    handleCheckedCitiesChange(value) {
      let checkedCount = value.length;
      this.checkAll = checkedCount === this.cities.length;
      this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
    }
  }
};
  </script>
  </script>
  
  